IntFLASH
 
 
 Bean IntFLASH
 
Internal FLASH

Typical usage of the bean in user's code.

Typical Usage:

Required bean name is "IntF1".
There are the following two typical usage modes:

(1)
The easiest example of a usage of the bean is a simple read and write internal FLASH.

 MAIN.C

byte Data;

void main(void)
{

  /* Write number 28 to address 0xE000 */
  IntF1_SetByteFlash(0xE000,28);
  /* Read contents of internal FLASH array on address 
     0xE000 and write it to variable Data */
  IntF1_GetByteFlash(0xE000,&Data);

}
Note: Address of FLASH is meant as absolute address, not index in FLASH array.

(2)
When 'Virtual page' property is enabled, methods using virtual page are avaiable. The following example reads data content of some FLASH area, modifies it, and stores it in other place in FLASH.

 MAIN.C


void main(void)
{
  
  // Fill virtual page with actual data content of address 0xE000
  IntF1_GetPage(0xE000);
  // Write number 23 to first cell of page 
  IntF1_SetBytePage(0,23);
// Write number 255 to second cell 
  IntF1_SetBytePage(1,255);
  // Store data content of virtual page to FLASH on address 0xE630
  IntF1_SetPage(0xE630);

}
Note: Method SetBytePage/GetBytePage use index 0 to PageSize-1

For more about typical usage of the bean code please refer to the page Bean Code Typical Usage.


Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.